{include file="public/toper" /}
<script type="text/javascript" src="/static/js/kalendae.standalone.js"></script>
<link rel="stylesheet" href="/static/css/kalendae.css">
<div class="x-nav">
  <span class="layui-breadcrumb">
    <a href="">账号信息</a>
  </span>
  <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新">
    <i class="layui-icon" style="line-height:30px">ဂ</i></a>
</div>
<div class="x-body">
    <form class="layui-form" id="admin">
        <input type="hidden" value="" name="goods_id"/>
        <div class="layui-form-item">
            <label for="store_name" class="layui-form-label">
                <span class="x-red">*</span>账号
            </label>
            <div class="layui-input-inline">
                <input type="text" id="store_name" value="{$info}" name="store_name" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label for="new_pass" class="layui-form-label">
                <span class="x-red">*</span>新密码
            </label>
            <div class="layui-input-inline">
                <input type="password" id="new_pass" value="" name="new_pass" required="" lay-verify="required" autocomplete="off" class="layui-input">
            </div>
            <div class="layui-form-mid layui-word-aux">
                <span class="x-red">*</span>
            </div>
        </div>
        <div class="layui-form-item">
            <label for="second_pass" class="layui-form-label">
                <span class="x-red">*</span>再输入一遍
            </label>
            <div class="layui-input-inline">
                <input type="password" id="second_pass" value="" name="second_pass" required="" lay-verify="required" autocomplete="off" class="layui-input">
            </div>
            <div class="layui-form-mid layui-word-aux">
                <span class="x-red">*</span>
            </div>
        </div>
        <div class="layui-form-item">
            <label for="L_repass" class="layui-form-label">
            </label>
            <button  class="layui-btn" lay-filter="admin" lay-submit>修改</button>
        </div>
    </form>
</div>
<script>
    layui.use(['upload','laydate'], function(){
        var $ = layui.jquery,
            upload = layui.upload;
        var laydate = layui.laydate;
    });




    layui.use(['form','layer'], function(){
        $ = layui.jquery;
        var form = layui.form
            ,layer = layui.layer;

        //自定义验证规则
        form.verify({
        });

        //监听提交
        $(window).on('load', function() {
            form.on('submit(admin)', function(data) {
                $.ajax({
                    url:"{:url('StoreInfo/changePass')}",
                    data:$('#admin').serialize(),
                    type:'post',
                    async: false,
                    success:function(res) {
                        if(res.code == 200) {
                            layer.msg(res.msg, {icon: 6});
                            setInterval('top.location.href="{:url('Login/login')}";',2000);
                        } else {
                            layer.msg(res.msg,{icon: 2});
                        }
                    }
                });
                return false;
            });
        });
    });
</script>
{include file="public/footer" /}